<?php defined('ABSPATH') or die("No script kiddies please!");?>
<?php get_header(); ?>
	<?php while ( have_posts() ) : the_post(); ?>
	<?php
		$video_attachment = ap_get_video_attachment();
		if($video_attachment) {
			echo "<div id='article-video'>".$video_attachment."</div>";
		}
	?>
	<div class="panel " id="article">
			<!-- article header -->
			<div id="article-meta">
				<p class="article-meta">
					<span class="article-datetime"><?php echo ap_get_publish_time(array('time'=>true,'weekday'=>true)); ?></span> |
					<span class="article-category"><?php echo ap_get_categories(); ?></span>
				</p>
				<h1 class="article-title"><?php the_title(); ?></h1>
				<p class="article-summary"><?php echo get_the_excerpt(); ?></p>
			</div>
			<div id="article-main" class='content-panel <?php echo get_post_format(); ?>'>
				<!-- article main content -->
				<div class="article-content">
					<?php
						$content = get_the_content();
						$content = apply_filters('the_content', get_the_content());
						echo $content;
					?>
				</div>
				<!-- article author/source/tag info -->
				<div class="article-info">
					<?php
						$author = ap_get_author();
						$source = ap_get_source();
						$source_link = ap_get_source_link();
						if($author!="") echo '<p class="author">'.$author.'</p>';
						if($source!="" || $source_link!="") {
							echo '<p class="source">';
							if($source!="") echo '<span class="name">Nguồn: <strong>'.$source.'</strong></span>';
							if($source_link!="") echo '<span class="link">Bài gốc: <a href="'.$source_link.'">'.$source_link.'</a></span>';
							echo '</p>';
						}
					?>
					<p class="tags">Chủ đề: <?php the_tags(); ?></p>
				</div>
				<!-- article comment -->
				<?php
				if (comments_open()) {
					comments_template();
				}
				?>
				<!-- article related -->
				<div class="article-aside">
					<!-- Related articles getting from tag of current article -->
					<?php
						ap_related_articles('list-layout nothumb',array(
							'widget_id'=>'relate-articles',
							// 'limit' => 10, // limit the number of post to display, default = 5
							// 'order_by' => 'date|views|rand', // order relate post, default by published date
							// 'category'=>true // only select related article from the same category
						));
					?>
					<!-- Most viewed article in same cate -->
					<?php
						$cates = "";
						foreach (get_the_category() as $category) {
							$cates .= $category->slug.",";
						}
						ap_get_posts('block-layout',array(
							'widget_id'=>'mostview-widget',
							'limit'=>5,
							'orderby'=>'views',
							'order'=>'DESC',
							'categories'=>preg_replace('/,$/', '', $cates),
							'before' => '<section class="widget" id="mostview-widget"><header class="widget-header"><h1>Xem nhiều nhất</h1></header><div class="widget-content">',
							'after' => '</div></section>'
						));
					?>
					<div class="banner size-160x600 scrollfixed">
						<object type="application/x-shockwave-flash" data="http://media.adtimaserver.vn/2014/11/286daa2c-0e62-453d-8503-972eb3d10348.swf" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" border="0" width="160" height="600"><param name="movie" value="http://media.adtimaserver.vn/2014/11/286daa2c-0e62-453d-8503-972eb3d10348.swf"><param name="AllowScriptAccess" value="always"><param name="quality" value="High"><param name="wmode" value="opaque"><param name="FlashVars" value="clickTARGET=_blank&amp;zid=2405389651443931836&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DC6VavZri3Tt_5g18RXQNeqA1q5mjYiSbzW0jdZpPD4UDIpsFwRp7PBApptdN_k1ezVJ8mVkUBesbNuLGan2M_Tz3q2_ChitYNrGvhsNo_3y65O0inx-87xjew4DDFW5HrNCoB782HRxBa7h2N6fVh84Vysw%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fwww.giaydathethao.com"><embed width="160" height="600" flashvars="clickTARGET=_blank&amp;zid=2405389651443931836&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DC6VavZri3Tt_5g18RXQNeqA1q5mjYiSbzW0jdZpPD4UDIpsFwRp7PBApptdN_k1ezVJ8mVkUBesbNuLGan2M_Tz3q2_ChitYNrGvhsNo_3y65O0inx-87xjew4DDFW5HrNCoB782HRxBa7h2N6fVh84Vysw%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fwww.giaydathethao.com" allowscriptaccess="always" wmode="opaque" quality="high" name="ZingAds" id="ZingAds" src="http://media.adtimaserver.vn/2014/11/286daa2c-0e62-453d-8503-972eb3d10348.swf" type="application/x-shockwave-flash"><a href="http://api.adtimaserver.vn/track/click?params=C6VavZri3Tt_5g18RXQNeqA1q5mjYiSbzW0jdZpPD4UDIpsFwRp7PBApptdN_k1ezVJ8mVkUBesbNuLGan2M_Tz3q2_ChitYNrGvhsNo_3y65O0inx-87xjew4DDFW5HrNCoB782HRxBa7h2N6fVh84Vysw&amp;uid=96635b89-dbe5-4d3a-aeac-2755ff213ae0&amp;redirectUrl=http%3A%2F%2Fwww.giaydathethao.com" target="_blank"><img src="http://media.adtimaserver.vn/2014/11/edae200a-71cc-435d-8b34-0407795be147.jpg" style="position:absolute; left: 0; top: 0;"></a></object>
					</div>
				</div>
			</div>
		<div class="aside-panel">
			<div class='banner size-300x250'>
				<object type="application/x-shockwave-flash" data="http://media.adtimaserver.vn/2014/10/588d9b6f-f78c-4bc4-ad3a-4b0594bec5ba.swf" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" border="0" width="300" height="250"><param name="movie" value="http://media.adtimaserver.vn/2014/10/588d9b6f-f78c-4bc4-ad3a-4b0594bec5ba.swf"><param name="AllowScriptAccess" value="always"><param name="quality" value="High"><param name="wmode" value="opaque"><param name="FlashVars" value="clickTARGET=_blank&amp;zid=56458834532064424&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DkT_wVbpi3TvlALWshfQN4NpdO9kjYr71uUUDNZrVkVXj4psFW2CSa36RLroianu5Fwf9lp0ZVhwdViv5ljK1PikfH6IGKf13mp0bXRIN4sVjGpAqrGDsHiYjAGGL4gUvgMBtGpwbYsFpHKwGmLzqIFg%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Flottecinemavn.com%252Fvi-vn%252Fphim%252Fquai-thu-%2528exist.aspx"><embed width="300" height="250" flashvars="clickTARGET=_blank&amp;zid=56458834532064424&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DkT_wVbpi3TvlALWshfQN4NpdO9kjYr71uUUDNZrVkVXj4psFW2CSa36RLroianu5Fwf9lp0ZVhwdViv5ljK1PikfH6IGKf13mp0bXRIN4sVjGpAqrGDsHiYjAGGL4gUvgMBtGpwbYsFpHKwGmLzqIFg%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Flottecinemavn.com%252Fvi-vn%252Fphim%252Fquai-thu-%2528exist.aspx" allowscriptaccess="always" wmode="opaque" quality="high" name="ZingAds" id="ZingAds" src="http://media.adtimaserver.vn/2014/10/588d9b6f-f78c-4bc4-ad3a-4b0594bec5ba.swf" type="application/x-shockwave-flash"><a href="http://api.adtimaserver.vn/track/click?params=kT_wVbpi3TvlALWshfQN4NpdO9kjYr71uUUDNZrVkVXj4psFW2CSa36RLroianu5Fwf9lp0ZVhwdViv5ljK1PikfH6IGKf13mp0bXRIN4sVjGpAqrGDsHiYjAGGL4gUvgMBtGpwbYsFpHKwGmLzqIFg&amp;uid=96635b89-dbe5-4d3a-aeac-2755ff213ae0&amp;redirectUrl=http%3A%2F%2Flottecinemavn.com%2Fvi-vn%2Fphim%2Fquai-thu-%28exist.aspx" target="_blank"><img src="http://media.adtimaserver.vn/2014/10/ee9f43d0-7abc-4646-8220-bc2bc969464f.jpg" style="position:absolute; left: 0; top: 0;"></a></object>
			</div>
			<div class="banner size-300x250">
				<object type="application/x-shockwave-flash" data="http://media.adtimaserver.vn/2014/11/0a8302a8-19e8-4703-bc9c-bccc41ff2a47.swf" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" border="0" width="300" height="250"><param name="movie" value="http://media.adtimaserver.vn/2014/11/0a8302a8-19e8-4703-bc9c-bccc41ff2a47.swf"><param name="AllowScriptAccess" value="always"><param name="quality" value="High"><param name="wmode" value="opaque"><param name="FlashVars" value="clickTARGET=_blank&amp;zid=1735161297688288341&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DgS_gNTpi3Tv1EFWshfQN8Cq9O9kjYq7lmcUDNZrFgTVj4psFS5Dzp9CD6n7yKPtnz7WpL9SD5lau0lCqompKRbZpB5-iBi7WUqjxYY1XrCv8lC6o8Uycv9hew4BJqwoXb1GF66_QhegVveik8GKcEGO6bUo%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fwww.vietjetair.com%252FSites%252FWeb%252Fvi-VN%252FNewsDetail%252Ftin-khuyen-mai%252F1574%252Fchao-duong-bay-moi-tp-ho-chi-minh-thanh-hoa-gia-chi-tu-0-dong%253Futm_source%253DZing%2526utm_medium%253DBanner_CPD%2526utm_campaign%253DSGN_THD_0K"><embed width="300" height="250" flashvars="clickTARGET=_blank&amp;zid=1735161297688288341&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DgS_gNTpi3Tv1EFWshfQN8Cq9O9kjYq7lmcUDNZrFgTVj4psFS5Dzp9CD6n7yKPtnz7WpL9SD5lau0lCqompKRbZpB5-iBi7WUqjxYY1XrCv8lC6o8Uycv9hew4BJqwoXb1GF66_QhegVveik8GKcEGO6bUo%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fwww.vietjetair.com%252FSites%252FWeb%252Fvi-VN%252FNewsDetail%252Ftin-khuyen-mai%252F1574%252Fchao-duong-bay-moi-tp-ho-chi-minh-thanh-hoa-gia-chi-tu-0-dong%253Futm_source%253DZing%2526utm_medium%253DBanner_CPD%2526utm_campaign%253DSGN_THD_0K" allowscriptaccess="always" wmode="opaque" quality="high" name="ZingAds" id="ZingAds" src="http://media.adtimaserver.vn/2014/11/0a8302a8-19e8-4703-bc9c-bccc41ff2a47.swf" type="application/x-shockwave-flash"><a href="http://api.adtimaserver.vn/track/click?params=gS_gNTpi3Tv1EFWshfQN8Cq9O9kjYq7lmcUDNZrFgTVj4psFS5Dzp9CD6n7yKPtnz7WpL9SD5lau0lCqompKRbZpB5-iBi7WUqjxYY1XrCv8lC6o8Uycv9hew4BJqwoXb1GF66_QhegVveik8GKcEGO6bUo&amp;uid=96635b89-dbe5-4d3a-aeac-2755ff213ae0&amp;redirectUrl=http%3A%2F%2Fwww.vietjetair.com%2FSites%2FWeb%2Fvi-VN%2FNewsDetail%2Ftin-khuyen-mai%2F1574%2Fchao-duong-bay-moi-tp-ho-chi-minh-thanh-hoa-gia-chi-tu-0-dong%3Futm_source%3DZing%26utm_medium%3DBanner_CPD%26utm_campaign%3DSGN_THD_0K" target="_blank"><img src="http://media.adtimaserver.vn/2014/11/8727990a-bbdc-4c93-8851-9b92d10d1055.jpg" style="position:absolute; left: 0; top: 0;"></a></object>
			</div>
			<section class="widget" id="mostview-widget">
				<header class='widget-header'>
					<h1><a href="#">Chuyên mục: Sao</a></h1>
				</header>
				<div class='widget-content'>
					<?php ap_get_posts('list-layout',array('limit'=>5,'orderby'=>'views','order'=>'DESC','categories'=>'showbiz,giai-tri')); ?>
				</div>
			</section>
			<div class="banner size-300x600 scrollfixed">
				<object type="application/x-shockwave-flash" data="http://media.adtimaserver.vn/2014/11/9c97cb58-2109-47c6-9253-2b072e321526.swf" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" border="0" width="300" height="600"><param name="movie" value="http://media.adtimaserver.vn/2014/11/9c97cb58-2109-47c6-9253-2b072e321526.swf"><param name="AllowScriptAccess" value="always"><param name="quality" value="High"><param name="wmode" value="opaque"><param name="FlashVars" value="clickTARGET=_blank&amp;zid=814800525424286111&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3Dz2EWdTpi3Tu7Kr08xXQNvvzl6xmjYuDXFR2DNZqLy92DIpsFBdaLuhUold4hD1WFxkMAyd_2Aeob2XnFcQfwHXgr62_Chy-xoxMBwUFAJA5SpPlijRw7FQLyJiNmD5-iBiT5AGZUqKUYWVg8ECqsXu0dISI%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fzing.vn%252Fyamahacamlaicuocdoi%252F%253Futm_source%253Dzingnews%2526utm_medium%253Dbanner%2526utm_campaign%253Dkhamphakhonggioihan"><embed width="300" height="600" flashvars="clickTARGET=_blank&amp;zid=814800525424286111&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3Dz2EWdTpi3Tu7Kr08xXQNvvzl6xmjYuDXFR2DNZqLy92DIpsFBdaLuhUold4hD1WFxkMAyd_2Aeob2XnFcQfwHXgr62_Chy-xoxMBwUFAJA5SpPlijRw7FQLyJiNmD5-iBiT5AGZUqKUYWVg8ECqsXu0dISI%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fzing.vn%252Fyamahacamlaicuocdoi%252F%253Futm_source%253Dzingnews%2526utm_medium%253Dbanner%2526utm_campaign%253Dkhamphakhonggioihan" allowscriptaccess="always" wmode="opaque" quality="high" name="ZingAds" id="ZingAds" src="http://media.adtimaserver.vn/2014/11/9c97cb58-2109-47c6-9253-2b072e321526.swf" type="application/x-shockwave-flash"><a href="http://api.adtimaserver.vn/track/click?params=z2EWdTpi3Tu7Kr08xXQNvvzl6xmjYuDXFR2DNZqLy92DIpsFBdaLuhUold4hD1WFxkMAyd_2Aeob2XnFcQfwHXgr62_Chy-xoxMBwUFAJA5SpPlijRw7FQLyJiNmD5-iBiT5AGZUqKUYWVg8ECqsXu0dISI&amp;uid=96635b89-dbe5-4d3a-aeac-2755ff213ae0&amp;redirectUrl=http%3A%2F%2Fzing.vn%2Fyamahacamlaicuocdoi%2F%3Futm_source%3Dzingnews%26utm_medium%3Dbanner%26utm_campaign%3Dkhamphakhonggioihan" target="_blank"><img src="http://media.adtimaserver.vn/2014/11/32b83984-9804-4e77-bfa2-fa00bd54c225.jpg" style="position:absolute; left: 0; top: 0;"></a></object>
			</div>
		</div>
	</div>
	<?php endwhile; // end of the loop. ?>
<?php get_footer(); ?>